package com.ouheng.shop.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ouheng.shop.dao.LebeOrderDao;
import com.ouheng.shop.domain.LebeOrderDO;
import com.ouheng.shop.domain.OhOrderDO;
import com.ouheng.shop.service.LebeOrderService;



@Service
public class LebeOrderServiceImpl implements LebeOrderService {
	@Autowired
	private LebeOrderDao lebeOrderDao;
	
	@Override
	public LebeOrderDO get(Long id){
		return lebeOrderDao.get(id);
	}
	
	@Override
	public List<LebeOrderDO> list(Map<String, Object> map){
		return lebeOrderDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return lebeOrderDao.count(map);
	}
	
	@Override
	public int save(LebeOrderDO lebeOrder){
		return lebeOrderDao.save(lebeOrder);
	}
	
	@Override
	public int update(LebeOrderDO lebeOrder){
		LebeOrderDO ohOrderDO = lebeOrderDao.get(lebeOrder.getId());
		if("2".equals(ohOrderDO.getStatus())){
			lebeOrder.setModifydate(new Date());
		}
		return lebeOrderDao.update(lebeOrder);
	}
	
	@Override
	public int remove(Long id){
		return lebeOrderDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return lebeOrderDao.batchRemove(ids);
	}
	
}
